$(document).ready(function() {
	var rpath = getRootPath() + "/";
	$('#resetCap').click(function() {
		var timestamp = (new Date()).valueOf(); 
		$.getJSON(rpath + "user/resetCaptcha/"+timestamp, function(data) {
			$('#capImg').html(data['image']);
			$("#test").val('');
		});
	});
	
	$('#submitCheck').click(function(event) {
		var str = document.getElementById('cardId').value;
		if (str.length <= 0) {
			$("#msg").html("请输入正确的卡号");
			$("#msg").css("display", "block");
			$(".err").hide();
			event.preventDefault();
		}else{
			str = trim($("#test").val());
			if (str.length <= 0) {
				$(".err").hide();
				$("#msg").html("请输入验证码");
				$("#msg").css("display", "block");
				event.preventDefault();
			}
		}
	});
});